#!/bin/bash
pass=123456
yum install expect -y 
[ ! -f ~/.ssh/id_rsa ] && ssh-keygen -t rsa -b 2048 -N "" -f ~/.ssh/id_rsa
for ip in 128 130
do
/usr/bin/expect<<-EOF
	spawn ssh-copy-id   root@192.168.88.$ip
        expect {
        "yes/no" { send "yes\r"; exp_continue }
        "password:" { send "$pass\r" }
        }
        expect eof


EOF
done
